package com.example.onlinemusic.mapper;

import com.example.onlinemusic.model.Music;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2022/7/26
 * \* Time: 16:47
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
@Mapper
public interface MusicMapper {
    /**
     * 插入音乐
     * @param title
     * @param singer
     * @param time
     * @param url
     * @param userid
     * @return
     */
    int insert(String title,String singer,String time,String url,int userid);

    /**
     * 查询当前的id的音乐是否存在
     * @param id
     * @return
     */
    Music finMusicById(int id);

    /**
     * 删除当前id的音乐
     * @param musicId
     * @return
     */
    int deleteMusicById(int musicId);

    /**
     * 查询所有音乐
     * @return
     */
    List<Music> findMusic();

    /**
     * 查询指定name音乐
     * @param name
     * @return
     */
    List<Music> findMusicByName(String name);
}
